package com.ys.enu;

import cn.hutool.core.util.StrUtil;
import com.ys.constants.ConstantsClientType;

import java.math.BigDecimal;
import java.math.BigInteger;

/**
 * 钱包类型枚举
 */
public enum CurrencyEnum {

    BTC(1000,"BTC","比特币","", ConstantsClientType.JSONRPC,1000,null,6,new BigDecimal("0.01E18").toBigInteger(),new BigInteger("1000000000000000000")),
    ETH(2000,"ETH","以太坊","", ConstantsClientType.JSONRPC,2000,null,12,new BigDecimal("0.01E18").toBigInteger(),new BigInteger("1000000000000000000")),
    ETC(2001,"ETC","以太经典","", ConstantsClientType.JSONRPC,2000,null,12,new BigDecimal("0.01E18").toBigInteger(),new BigInteger("1000000000000000000")),
    YSHB(2002,"YSHB","原始伙伴","", ConstantsClientType.JSONRPC,2000,null,12,new BigDecimal("0.01E18").toBigInteger(),new BigInteger("1000000000000000000")),
    ;

    public int currency;
    public String name;
    public String cName;
    public String hotAddress;
    public int clintType;//客户端方式 1：JsonRpc,2：SDK，3：其它
    public int currencyChainType;
    public String contractAddress;
    public int confirmNum;//交易确认数量
    public BigInteger gatherMaxBalance;
    public BigInteger decimal;


    CurrencyEnum(int currency, String name, String cName, String hotAddress, int clintType,
                 int currencyChainType,String contractAddress,int confirmNum,BigInteger gatherMaxBalance,
                 BigInteger decimal
    ) {
        this.currency = currency;
        this.name = name;
        this.cName = cName;
        this.hotAddress = hotAddress;
        this.clintType = clintType;
        this.currencyChainType = currencyChainType;
        this.contractAddress=contractAddress;
        this.confirmNum=confirmNum;
        this.gatherMaxBalance=gatherMaxBalance;
        this.decimal=decimal;
    }


    public static CurrencyEnum parseContractAddress(String contractAddress) {
        for (final CurrencyEnum curencyEnum : CurrencyEnum.values()) {
            if (StrUtil.isNotBlank(curencyEnum.getContractAddress())&& curencyEnum.getContractAddress().equals(contractAddress)) {
                return curencyEnum;
            }
        }
        return null;
    }


    public static CurrencyEnum parseCurrency(int currency) {
        for (final CurrencyEnum currencyEnum : CurrencyEnum.values()) {
            if (currencyEnum.getCurrency()==currency) {
                return currencyEnum;
            }
        }
        return null;
    }


    public int getCurrency() {
        return currency;
    }

    public void setCurrency(int currency) {
        this.currency = currency;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getcName() {
        return cName;
    }

    public void setcName(String cName) {
        this.cName = cName;
    }

    public String getHotAddress() {
        return hotAddress;
    }

    public void setHotAddress(String hotAddress) {
        this.hotAddress = hotAddress;
    }

    public int getClintType() {
        return clintType;
    }

    public void setClintType(int clintType) {
        this.clintType = clintType;
    }

    public int getCurrencyChainType() {
        return currencyChainType;
    }

    public void setCurrencyChainType(int currencyChainType) {
        this.currencyChainType = currencyChainType;
    }

    public String getContractAddress() {
        return contractAddress;
    }

    public void setContractAddress(String contractAddress) {
        this.contractAddress = contractAddress;
    }

    public int getConfirmNum() {
        return confirmNum;
    }

    public void setConfirmNum(int confirmNum) {
        this.confirmNum = confirmNum;
    }

    public BigInteger getGatherMaxBalance() {
        return gatherMaxBalance;
    }

    public void setGatherMaxBalance(BigInteger gatherMaxBalance) {
        this.gatherMaxBalance = gatherMaxBalance;
    }

    public static void main(String[] args) {
        System.out.printf(new BigInteger("1000000000000000000").toString());
    }
}
